package com.li.configure;

import com.li.exception.LogInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @program: rocketmq_boot
 * @description:
 * @author: li
 * @create: 2023-03-10 16:15
 **/
@Configuration
public class WebConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 添加拦截器并设置拦截路径
        registry.addInterceptor(new LogInterceptor()).addPathPatterns("/**");
    }
}
